#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

#define err() do { perror("client1"); exit(EXIT_FAILURE); } while(0)

int main(int argc, char *argv[])
{
	int shmid;
	char * data;
	if((shmid = shmget(7976, 1024, 0644 | IPC_CREAT)) == -1)
		err();
	data = shmat(shmid, (void *)0, 0);
	if(data == (char *)(-1))
		err();
	printf(data);
	shmdt(data);
	return 0;
}
